//
//  PLStrickoutLabel.m
//  PlatformCommon
//
//  Created by KimmanYip on 2018/2/10.
//

#import "PLStrickoutLabel.h"

@implementation PLStrickoutLabel

- (void)drawRect:(CGRect)rect {
    [super drawRect:rect];
    
    if(!_color){
        _color = [UIColor grayColor];
    }
    
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextBeginPath(context);
    CGContextSetLineWidth(context, 0.5);
    CGContextSetStrokeColorWithColor(context, _color.CGColor);
    CGContextMoveToPoint(context, 0, self.frame.size.height / 2.0);
    CGContextAddLineToPoint(context, rect.size.width, self.frame.size.height/2.0);
    CGContextDrawPath(context, kCGPathEOFillStroke);
}

@end
